import request from '@/utils/request'

export const getDepartmentsListAPI = () => {
  return request.get('/company/department')
}
// 删除-部门详情
export const delDepartmentsListAPI = (id) => {
  return request.delete(`/company/department/${id}`)
}

// 获取-部门负责人列表
export const getUserSimpleListAPI = () => {
  return request.get('/sys/user/simple')
}

// 新增-部门
export const addDepartmentAPI = form => {
  return request({
    url: '/company/department',
    method: 'post',
    data: form
  })
}

// 获取部门详情
export const getDepartmentDetailAPI = id => {
  return request.get(`/company/department/${id}`)
}

// 修改-部门详情
export const editDepartmentAPI = data => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
